import rxAjax from '@/assets/js/ajax.js';
import AtsLegalHolidayDetailApi from "@/api/oa/ats/atsLegalHolidayDetail";

//考勤制度 api接口
export const AtsAttencePolicyApi = {};

AtsAttencePolicyApi.baseUrl= '/api-oa/oa/ats/atsAttencePolicy';
AtsAttencePolicyApi.exportUrl= AtsAttencePolicyApi.baseUrl + '/listExport';

//查询列表
AtsAttencePolicyApi.query=function (parameter) {
  var url= AtsAttencePolicyApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
 * 获取单记录
 * @param pkId
 * @returns {*}
 */
AtsAttencePolicyApi.get =function(pkId) {
  var url= AtsAttencePolicyApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
AtsAttencePolicyApi.save =function(parameter) {
  var url= AtsAttencePolicyApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
AtsAttencePolicyApi.del =function(parameter) {
  var url= AtsAttencePolicyApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

//查询全部数据
AtsAttencePolicyApi.getAll = function () {
  var url = AtsAttencePolicyApi.baseUrl + '/getAll';
  return rxAjax.get(url);
}

AtsAttencePolicyApi.getId = function (pkId) {
  var url = AtsAttencePolicyApi.baseUrl + '/getId?pkId=' + pkId;
  return rxAjax.get(url);
}

AtsAttencePolicyApi.getLegalHoliday = function (selectData) {
  var url = AtsAttencePolicyApi.baseUrl + '/getLegalHoliday';
  return rxAjax.postJson(url,selectData);
}



export  default AtsAttencePolicyApi;

